﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LittleredSkill : SkillBase
{
    public float skillRange = 3f;
    public override void Cast()
    {
        if (!isInCooldown())
        {
            lastCastTime = Time.time;
            StartCoroutine(SkillCountdown());
        }
    }

    public override void skillStart()
    {
        Collider2D[] colliders = Physics2D.OverlapCircleAll(this.transform.position, skillRange);
        if (colliders.Length > 0)
        {
            foreach (Collider2D c in colliders)
            {
                if (c.gameObject.tag == "Coin")
                {
                    c.gameObject.GetComponent<CoinAI>().onDiggingOut();
                }
            }
            // enemies within 1m of the player
        }
    }
    public override void skillEnd()
    {

    }
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
